home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / doom / chaserog.zip / SRC_ROG.ZIP / DEFS.QC < prev    next >
Text File  |  1997-05-10  |  23KB  |  910 lines

  1.  
  2. /*
  3. ==============================================================================
  4.  
  5.             SOURCE FOR GLOBALVARS_T C STRUCTURE
  6.  
  7. ==============================================================================
  8. */
  9.  
  10. //
  11. // system globals
  12. //
  13. entity        self;
  14. entity        other;
  15. entity        world;
  16. float        time;
  17. float        frametime;
  18.  
  19. float        force_retouch;        // force all entities to touch triggers
  20.                                 // next frame.  this is needed because
  21.                                 // non-moving things don't normally scan
  22.                                 // for triggers, and when a trigger is
  23.                                 // created (like a teleport trigger), it
  24.                                 // needs to catch everything.
  25.                                 // decremented each frame, so set to 2
  26.                                 // to guarantee everything is touched
  27. string        mapname;
  28.  
  29. float        deathmatch;
  30. float        coop;
  31. float        teamplay;
  32. //float        norandom;            // ROGUE: disable random respawn of powerups.
  33.  
  34. float        serverflags;        // propagated from level to level, used to
  35.                                 // keep track of completed episodes
  36.  
  37. float        total_secrets;
  38. float        total_monsters;
  39.  
  40. float        found_secrets;        // number of secrets found
  41. float        killed_monsters;    // number of monsters killed
  42.  
  43.  
  44. // spawnparms are used to encode information about clients across server
  45. // level changes
  46. float        parm1, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, parm10, parm11, parm12, parm13, parm14, parm15, parm16;
  47.  
  48. //
  49. // global variables set by built in functions
  50. //    
  51. vector        v_forward, v_up, v_right;    // set by makevectors()
  52.     
  53. // set by traceline / tracebox
  54. float        trace_allsolid;
  55. float        trace_startsolid;
  56. float        trace_fraction;
  57. vector        trace_endpos;
  58. vector        trace_plane_normal;
  59. float        trace_plane_dist;
  60. entity        trace_ent;
  61. float        trace_inopen;
  62. float        trace_inwater;
  63.  
  64. entity        msg_entity;                // destination of single entity writes
  65.  
  66. //
  67. // required prog functions
  68. //
  69. void()         main;                        // only for testing
  70.  
  71. void()        StartFrame;
  72.  
  73. void()         PlayerPreThink;
  74. void()         PlayerPostThink;
  75.  
  76. void()        ClientKill;
  77. void()        ClientConnect;
  78. void()         PutClientInServer;        // call after setting the parm1... parms
  79. void()        ClientDisconnect;
  80.  
  81. void()        SetNewParms;            // called when a client first connects to
  82.                                     // a server. sets parms so they can be
  83.                                     // saved off for restarts
  84.  
  85. void()        SetChangeParms;            // call to set parms for self so they can
  86.                                     // be saved for a level transition
  87.  
  88.  
  89. //================================================
  90. void        end_sys_globals;        // flag for structure dumping
  91. //================================================
  92.  
  93. /*
  94. ==============================================================================
  95.  
  96.             SOURCE FOR ENTVARS_T C STRUCTURE
  97.  
  98. ==============================================================================
  99. */
  100.  
  101. //
  102. // system fields (*** = do not set in prog code, maintained by C code)
  103. //
  104. .float        modelindex;        // *** model index in the precached list
  105. .vector        absmin, absmax;    // *** origin + mins / maxs
  106.  
  107. .float        ltime;            // local time for entity
  108. .float        movetype;
  109. .float        solid;
  110.  
  111. .vector        origin;            // ***
  112. .vector        oldorigin;        // ***
  113. .vector        velocity;
  114. .vector        angles;
  115. .vector        avelocity;
  116.  
  117. .vector        punchangle;        // temp angle adjust from damage or recoil
  118.  
  119. .string        classname;        // spawn function
  120. .string        model;
  121. .float        frame;
  122. .float        skin;
  123. .float        effects;
  124.  
  125. .vector        mins, maxs;        // bounding box extents reletive to origin
  126. .vector        size;            // maxs - mins
  127.  
  128. .void()        touch;
  129. .void()        use;
  130. .void()        think;
  131. .void()        blocked;        // for doors or plats, called when can't push other
  132.  
  133. .float        nextthink;
  134. .entity        groundentity;
  135.  
  136. // stats
  137. .float        health;
  138. .float        frags;
  139. .float        weapon;            // one of the IT_SHOTGUN, etc flags
  140. .string        weaponmodel;
  141. .float        weaponframe;
  142. .float        currentammo;
  143. .float        ammo_shells, ammo_nails, ammo_rockets, ammo_cells;
  144.  
  145. .float        items;            // bit flags
  146.  
  147. .float        takedamage;
  148. .entity        chain;
  149. .float        deadflag;
  150.  
  151. .vector        view_ofs;            // add to origin to get eye point
  152.  
  153.  
  154. .float        button0;        // fire
  155. .float        button1;        // use
  156. .float        button2;        // jump
  157.  
  158. .float        impulse;        // weapon changes
  159.  
  160. .float        fixangle;
  161. .vector        v_angle;        // view / targeting angle for players
  162. .float        idealpitch;        // calculated pitch angle for lookup up slopes
  163.  
  164.  
  165. .string        netname;
  166.  
  167. .entity     enemy;
  168.  
  169. .float        flags;
  170.  
  171. .float        colormap;
  172. .float        team;
  173.  
  174. .float        max_health;        // players maximum health is stored here
  175.  
  176. .float        teleport_time;    // don't back up
  177.  
  178. .float        armortype;        // save this fraction of incoming damage
  179. .float        armorvalue;
  180.  
  181. .float        waterlevel;        // 0 = not in, 1 = feet, 2 = wast, 3 = eyes
  182. .float        watertype;        // a contents value
  183.  
  184. .float        ideal_yaw;
  185. .float        yaw_speed;
  186.  
  187. .entity        aiment;
  188.  
  189. .entity     goalentity;        // a movetarget or an enemy
  190.  
  191. .float        spawnflags;
  192.  
  193. .string        target;
  194. .string        targetname;
  195.  
  196. // damage is accumulated through a frame. and sent as one single
  197. // message, so the super shotgun doesn't generate huge messages
  198. .float        dmg_take;
  199. .float        dmg_save;
  200. .entity        dmg_inflictor;
  201.  
  202. .entity        owner;        // who launched a missile
  203. .vector        movedir;    // mostly for doors, but also used for waterjump
  204.  
  205. .string        message;        // trigger messages
  206.  
  207. .float        sounds;        // either a cd track number or sound number
  208.  
  209. .string        noise, noise1, noise2, noise3;    // contains names of wavs to play
  210.  
  211. //================================================
  212. void        end_sys_fields;            // flag for structure dumping
  213. //================================================
  214.  
  215. .float        items2;
  216. //.float        new_weapon;
  217. //.float        new_items;
  218. .float        ammo_shells1, ammo_nails1, ammo_rockets1, ammo_cells1;
  219. .float        ammo_lava_nails, ammo_multi_rockets, ammo_plasma;
  220. .float        gravity;
  221.  
  222. /*
  223. ==============================================================================
  224.  
  225.                 VARS NOT REFERENCED BY C CODE
  226.  
  227. ==============================================================================
  228. */
  229.  
  230.  
  231. //
  232. // constants
  233. //
  234.  
  235. float    FALSE                    = 0;
  236. float     TRUE                    = 1;
  237.  
  238. // edict.flags
  239. float    FL_FLY                    = 1;
  240. float    FL_SWIM                    = 2;
  241. float    FL_CLIENT                = 8;    // set for all client edicts
  242. float    FL_INWATER                = 16;    // for enter / leave water splash
  243. float    FL_MONSTER                = 32;
  244. float    FL_GODMODE                = 64;    // player cheat
  245. float    FL_NOTARGET                = 128;    // player cheat
  246. float    FL_ITEM                    = 256;    // extra wide size for bonus items
  247. float    FL_ONGROUND                = 512;    // standing on something
  248. float    FL_PARTIALGROUND        = 1024;    // not all corners are valid
  249. float    FL_WATERJUMP            = 2048;    // player jumping out of water
  250. float    FL_JUMPRELEASED            = 4096;    // for jump debouncing
  251.  
  252. // edict.movetype values
  253. float    MOVETYPE_NONE            = 0;    // never moves
  254. //float    MOVETYPE_ANGLENOCLIP    = 1;
  255. //float    MOVETYPE_ANGLECLIP        = 2;
  256. float    MOVETYPE_WALK            = 3;    // players only
  257. float    MOVETYPE_STEP            = 4;    // discrete, not real time unless fall
  258. float    MOVETYPE_FLY            = 5;
  259. float    MOVETYPE_TOSS            = 6;    // gravity
  260. float    MOVETYPE_PUSH            = 7;    // no clip to world, push and crush
  261. float    MOVETYPE_NOCLIP            = 8;
  262. float    MOVETYPE_FLYMISSILE        = 9;    // fly with extra size against monsters
  263. float    MOVETYPE_BOUNCE            = 10;
  264. float    MOVETYPE_BOUNCEMISSILE    = 11;    // bounce with extra size
  265.  
  266. // edict.solid values
  267. float    SOLID_NOT                = 0;    // no interaction with other objects
  268. float    SOLID_TRIGGER            = 1;    // touch on edge, but not blocking
  269. float    SOLID_BBOX                = 2;    // touch on edge, block
  270. float    SOLID_SLIDEBOX            = 3;    // touch on edge, but not an onground
  271. float    SOLID_BSP                = 4;    // bsp clip, touch on edge, block
  272.  
  273. // range values
  274. float    RANGE_MELEE                = 0;
  275. float    RANGE_NEAR                = 1;
  276. float    RANGE_MID                = 2;
  277. float    RANGE_FAR                = 3;
  278.  
  279. // deadflag values
  280.  
  281. float    DEAD_NO                    = 0;
  282. float    DEAD_DYING                = 1;
  283. float    DEAD_DEAD                = 2;
  284. float    DEAD_RESPAWNABLE        = 3;
  285.  
  286. // takedamage values
  287.  
  288. float    DAMAGE_NO                = 0;
  289. float    DAMAGE_YES                = 1;
  290. float    DAMAGE_AIM                = 2;
  291.  
  292. // items
  293. float    IT_AXE                    = 2048;        // 1
  294. float    IT_SHOTGUN                = 1;
  295. float    IT_SUPER_SHOTGUN        = 2;
  296. float    IT_NAILGUN                = 4;
  297. float    IT_SUPER_NAILGUN        = 8;
  298. float    IT_GRENADE_LAUNCHER        = 16;
  299. float    IT_ROCKET_LAUNCHER        = 32;
  300. float    IT_LIGHTNING            = 64;            // 8
  301. float    IT_SHELLS                = 128;
  302. float    IT_NAILS                = 256;
  303. float    IT_ROCKETS                = 512;
  304. float    IT_CELLS                = 1024;
  305. float    IT_LAVA_NAILGUN            = 4096;        
  306. float     IT_LAVA_SUPER_NAILGUN    = 8192;            
  307. float     IT_MULTI_GRENADE        = 16384;        //15
  308. float    IT_MULTI_ROCKET            = 32768;
  309. float    IT_PLASMA_GUN            = 65536;    
  310. float    IT_KEY1                    = 131072;
  311. float    IT_KEY2                    = 262144;        
  312. float    IT_INVISIBILITY            = 524288;
  313. float    IT_INVULNERABILITY        = 1048576;
  314. float    IT_SUIT                    = 2097152;
  315. float    IT_QUAD                    = 4194304;        //23
  316. //ZOID --
  317. float    IT_GRAPPLE                = 8388608;        // grapple overload, hope it
  318. //-- ZOID                                        // doesn't mess things up!
  319.                                                 
  320.  
  321. float    IT2_ARMOR1                = 1;            //24
  322. float    IT2_ARMOR2                = 2;
  323. float    IT2_ARMOR3                = 4;
  324. float    IT2_LAVA_NAILS            = 8;
  325. float    IT2_PLASMA_AMMO            = 16;
  326. float    IT2_MULTI_ROCKETS        = 32;            //29
  327. float     IT2_SHIELD                = 64;
  328. float     IT2_ANTIGRAV            = 128;
  329. float    IT2_SUPERHEALTH            = 256;            //32
  330. float    IT2_EARTHQUAKE            = 512;            
  331. float    IT2_V_SPHERE            = 1024;
  332.  
  333. // point content values
  334.  
  335. float    CONTENT_EMPTY            = -1;
  336. float    CONTENT_SOLID            = -2;
  337. float    CONTENT_WATER            = -3;
  338. float    CONTENT_SLIME            = -4;
  339. float    CONTENT_LAVA            = -5;
  340. float    CONTENT_SKY                = -6;
  341.  
  342. float    STATE_TOP        = 0;
  343. float    STATE_BOTTOM    = 1;
  344. float    STATE_UP        = 2;
  345. float    STATE_DOWN        = 3;
  346.  
  347. vector    VEC_ORIGIN = '0 0 0';
  348. vector    VEC_HULL_MIN = '-16 -16 -24';
  349. vector    VEC_HULL_MAX = '16 16 32';
  350.  
  351. vector    VEC_HULL2_MIN = '-32 -32 -24';
  352. vector    VEC_HULL2_MAX = '32 32 64';
  353.  
  354. // protocol bytes
  355. float    SVC_UPDATESTAT        = 3;        // pgm black magic
  356.  
  357. float    SVC_TEMPENTITY        = 23;
  358. float    SVC_KILLEDMONSTER    = 27;
  359. float    SVC_FOUNDSECRET        = 28;
  360. float    SVC_INTERMISSION    = 30;
  361. float    SVC_FINALE            = 31;
  362. float    SVC_CDTRACK            = 32;
  363. float    SVC_SELLSCREEN        = 33;
  364. float    SVC_CUTSCENE        = 34;
  365.  
  366. float    STAT_TOTALMONSTERS    = 12;        // pgm black magic
  367.  
  368. float    TE_SPIKE        = 0;
  369. float    TE_SUPERSPIKE    = 1;
  370. float    TE_GUNSHOT        = 2;
  371. float    TE_EXPLOSION    = 3;
  372. float    TE_TAREXPLOSION    = 4;
  373. float    TE_LIGHTNING1    = 5;
  374. float    TE_LIGHTNING2    = 6;
  375. float    TE_WIZSPIKE        = 7;
  376. float    TE_KNIGHTSPIKE    = 8;
  377. float    TE_LIGHTNING3    = 9;
  378. float    TE_LAVASPLASH    = 10;
  379. float    TE_TELEPORT        = 11;
  380. float   TE_EXPLOSION2   = 12;
  381. float    TE_BEAM            = 13;              
  382.  
  383. // sound channels
  384. // channel 0 never willingly overrides
  385. // other channels (1-7) allways override a playing sound on that channel
  386. float    CHAN_AUTO        = 0;
  387. float    CHAN_WEAPON        = 1;
  388. float    CHAN_VOICE        = 2;
  389. float    CHAN_ITEM        = 3;
  390. float    CHAN_BODY        = 4;
  391.  
  392. float    ATTN_NONE        = 0;
  393. float    ATTN_NORM        = 1;
  394. float    ATTN_IDLE        = 2;
  395. float    ATTN_STATIC        = 3;
  396.  
  397. // update types
  398.  
  399. float    UPDATE_GENERAL    = 0;
  400. float    UPDATE_STATIC    = 1;
  401. float    UPDATE_BINARY    = 2;
  402. float    UPDATE_TEMP        = 3;
  403.  
  404. // entity effects
  405.  
  406. float    EF_BRIGHTFIELD    = 1;
  407. float    EF_MUZZLEFLASH     = 2;
  408. float    EF_BRIGHTLIGHT     = 4;
  409. float    EF_DIMLIGHT     = 8;
  410.  
  411.  
  412. // messages
  413. float    MSG_BROADCAST    = 0;        // unreliable to all
  414. float    MSG_ONE            = 1;        // reliable to one (msg_entity)
  415. float    MSG_ALL            = 2;        // reliable to all
  416. float    MSG_INIT        = 3;        // write to the init string
  417.  
  418. //================================================
  419.  
  420. //
  421. // globals
  422. //
  423. float    movedist;
  424. float    gameover;        // set when a rule exits
  425.  
  426. string    string_null;    // null string, nothing should be held here
  427. float    empty_float;
  428.  
  429. entity    newmis;            // launch_spike sets this after spawning it
  430.  
  431. entity    activator;        // the entity that activated a trigger or brush
  432.  
  433. entity    damage_attacker;    // set by T_Damage
  434. float    framecount;
  435.  
  436. float        skill;
  437.  
  438. // rogue globals!
  439. float     earthquake_active;
  440. float    earthquake_intensity;
  441. float    cutscene_running;
  442. entity  tag_token_owner;
  443.  
  444. //================================================
  445.  
  446. //
  447. // world fields (FIXME: make globals)
  448. //
  449. .string        wad;
  450. .string     map;
  451. .float        worldtype;    // 0=medieval 1=metal 2=base
  452.  
  453. //================================================
  454.  
  455. .string        killtarget;
  456.  
  457. //
  458. // quakeed fields
  459. //
  460. .float        light_lev;        // not used by game, but parsed by light util
  461. .float        style;
  462.  
  463.  
  464. //
  465. // monster ai
  466. //
  467. .void()        th_stand;
  468. .void()        th_walk;
  469. .void()        th_run;
  470. .void()        th_missile;
  471. .void()        th_melee;
  472. .void(entity attacker, float damage)        th_pain;
  473. .void()        th_die;
  474.  
  475. .entity        oldenemy;        // mad at this player before taking damage
  476.  
  477. .float        speed;
  478.  
  479. .float    lefty;
  480.  
  481. .float    search_time;
  482. .float    attack_state;
  483.  
  484. float    AS_STRAIGHT        = 1;
  485. float    AS_SLIDING        = 2;
  486. float    AS_MELEE        = 3;
  487. float    AS_MISSILE        = 4;
  488.  
  489. //
  490. // player only fields
  491. //
  492. .float        walkframe;
  493.  
  494. .float         attack_finished;
  495. .float        pain_finished;
  496.  
  497. .float        invincible_finished;
  498. .float        invisible_finished;
  499. .float        super_damage_finished;
  500. .float        radsuit_finished;
  501.  
  502. .float        invincible_time, invincible_sound;
  503. .float        invisible_time, invisible_sound;
  504. .float        super_time, super_sound;
  505. .float        rad_time;
  506. .float        fly_sound;
  507.  
  508. .float        shield_finished, antigrav_finished;
  509. .float        shield_time, antigrav_time;
  510. .entity        shield_entity;
  511.  
  512. .float        axhitme;
  513.  
  514. .float        show_hostile;    // set to time+0.2 whenever a client fires a
  515.                             // weapon or takes damage.  Used to alert
  516.                             // monsters that otherwise would let the player go
  517. .float        jump_flag;        // player jump flag
  518. .float        swim_flag;        // player swimming sound flag
  519. .float        air_finished;    // when time > air_finished, start drowning
  520. .float        bubble_count;    // keeps track of the number of bubbles
  521. .string        deathtype;        // keeps track of how the player died
  522.  
  523. //
  524. // object stuff
  525. //
  526. .string        mdl;
  527. .vector        mangle;            // angle at start
  528.  
  529. .vector        oldorigin;        // only used by secret door
  530.  
  531. .float        t_length, t_width;
  532.  
  533.  
  534. //
  535. // doors, etc
  536. //
  537. .vector        dest, dest1, dest2;
  538. .float        wait;            // time from firing to restarting
  539. .float        delay;            // time from activation to firing
  540. .entity        trigger_field;    // door's trigger entity
  541. .string        noise4;
  542.  
  543. //
  544. // monsters
  545. //
  546. .float         pausetime;
  547. .entity     movetarget;
  548.  
  549.  
  550. //
  551. // doors
  552. //
  553. .float        aflag;
  554. .float        dmg;            // damage done by door when hit
  555.     
  556. //
  557. // misc
  558. //
  559. .float        cnt;             // misc flag
  560.     
  561. //
  562. // subs
  563. //
  564. .void()        think1;
  565. .vector        finaldest, finalangle;
  566.  
  567. //
  568. // triggers
  569. //
  570. .float        count;            // for counting triggers
  571.  
  572.  
  573. //
  574. // plats / doors / buttons
  575. //
  576. .float        lip;
  577. .float        state;
  578. .vector        pos1, pos2;        // top and bottom positions
  579. .float        height;
  580.  
  581. //
  582. // sounds
  583. //
  584. .float        waitmin, waitmax;
  585. .float        distance;
  586. .float        volume;
  587.  
  588.  
  589. //
  590. // elevator fields
  591. //
  592.  
  593. .float         elevatorLastUse;
  594. .float        elevatorOnFloor;
  595. .float        elevatorToFloor;
  596. .vector        elevatorDestination; 
  597.  
  598. //
  599. // plat2 fields
  600. //
  601. .float        plat2Called;
  602. .float        plat2LastMove;
  603. .float        plat2GoTime;
  604. .float        plat2GoTo;
  605.  
  606. //
  607. // new AI fields
  608. //
  609. .float        orbitPosition;
  610.  
  611. //
  612. // dragon specific fields
  613. // 
  614. .float playerInRoom;
  615. .float playerInTransit;
  616. .float dragonInRoom;
  617. .float dragonInTransit;
  618. .float dragonAttacking;
  619. .float dragonPainSequence;
  620. .vector dragonLastVelocity;
  621.  
  622. //
  623. // Other Rogue Fields
  624. //
  625. .float        AGping;
  626. .float        childrenSpawned;
  627. .float        ltrailLastUsed;
  628. .float        shield_death_time;
  629. .float        shieldSoundTime;
  630. .float        dragonDeathState;
  631.  
  632. .float        tag_frags;
  633. .float        tag_message_time;
  634.  
  635. //===========================================================================
  636.     
  637.  
  638. //
  639. // builtin functions
  640. //
  641.  
  642. void(vector ang)    makevectors        = #1;        // sets v_forward, etc globals
  643. void(entity e, vector o) setorigin    = #2;
  644. void(entity e, string m) setmodel    = #3;        // set movetype and solid first
  645. void(entity e, vector min, vector max) setsize = #4;
  646. // #5 was removed
  647. void() break                        = #6;
  648. float() random                        = #7;        // returns 0 - 1
  649. void(entity e, float chan, string samp, float vol, float atten) sound = #8;
  650. vector(vector v) normalize            = #9;
  651. void(string e) error                = #10;
  652. void(string e) objerror                = #11;
  653. float(vector v) vlen                = #12;
  654. float(vector v) vectoyaw            = #13;
  655. entity() spawn                        = #14;
  656. void(entity e) remove                = #15;
  657.  
  658. // sets trace_* globals
  659. // nomonsters can be:
  660. // An entity will also be ignored for testing if forent == test,
  661. // forent->owner == test, or test->owner == forent
  662. // a forent of world is ignored
  663. void(vector v1, vector v2, float nomonsters, entity forent) traceline = #16;    
  664.  
  665. entity() checkclient                = #17;    // returns a client to look for
  666. entity(entity start, .string fld, string match) find = #18;
  667. string(string s) precache_sound        = #19;
  668. string(string s) precache_model        = #20;
  669. void(entity client, string s)stuffcmd = #21;
  670. entity(vector org, float rad) findradius = #22;
  671. void(string s) bprint                = #23;
  672. void(entity client, string s) sprint = #24;
  673. void(string s) dprint                = #25;
  674. string(float f) ftos                = #26;
  675. string(vector v) vtos                = #27;
  676. void() coredump                        = #28;        // prints all edicts
  677. void() traceon                        = #29;        // turns statment trace on
  678. void() traceoff                        = #30;
  679. void(entity e) eprint                = #31;        // prints an entire edict
  680. float(float yaw, float dist) walkmove    = #32;    // returns TRUE or FALSE
  681. // #33 was removed
  682. float(float yaw, float dist) droptofloor= #34;    // TRUE if landed on floor
  683. void(float style, string value) lightstyle = #35;
  684. float(float v) rint                    = #36;        // round to nearest int
  685. float(float v) floor                = #37;        // largest integer <= v
  686. float(float v) ceil                    = #38;        // smallest integer >= v
  687. // #39 was removed
  688. float(entity e) checkbottom            = #40;        // true if self is on ground
  689. float(vector v) pointcontents        = #41;        // returns a CONTENT_*
  690. // #42 was removed
  691. float(float f) fabs = #43;
  692. vector(entity e, float speed) aim = #44;        // returns the shooting vector
  693. float(string s) cvar = #45;                        // return cvar.value
  694. void(string s) localcmd = #46;                    // put string into local que
  695. entity(entity e) nextent = #47;                    // for looping through all ents
  696. void(vector o, vector d, float color, float count) particle = #48;// start a particle effect
  697. void() ChangeYaw = #49;                        // turn towards self.ideal_yaw
  698.                                             // at self.yaw_speed
  699. // #50 was removed
  700. vector(vector v) vectoangles            = #51;
  701.  
  702. //
  703. // direct client message generation
  704. //
  705. void(float to, float f) WriteByte        = #52;
  706. void(float to, float f) WriteChar        = #53;
  707. void(float to, float f) WriteShort        = #54;
  708. void(float to, float f) WriteLong        = #55;
  709. void(float to, float f) WriteCoord        = #56;
  710. void(float to, float f) WriteAngle        = #57;
  711. void(float to, string s) WriteString    = #58;
  712. void(float to, entity s) WriteEntity    = #59;
  713.  
  714. //
  715. // broadcast client message generation
  716. //
  717.  
  718. // void(float f) bWriteByte        = #59;
  719. // void(float f) bWriteChar        = #60;
  720. // void(float f) bWriteShort        = #61;
  721. // void(float f) bWriteLong        = #62;
  722. // void(float f) bWriteCoord        = #63;
  723. // void(float f) bWriteAngle        = #64;
  724. // void(string s) bWriteString    = #65;
  725. // void(entity e) bWriteEntity = #66;
  726.  
  727. void(float step) movetogoal                = #67;
  728.  
  729. string(string s) precache_file        = #68;    // no effect except for -copy
  730. void(entity e) makestatic        = #69;
  731. void(string s) changelevel = #70;
  732.  
  733. //#71 was removed
  734.  
  735. void(string var, string val) cvar_set = #72;    // sets cvar.value
  736.  
  737. void(entity client, string s) centerprint = #73;    // sprint, but in middle
  738.  
  739. void(vector pos, string samp, float vol, float atten) ambientsound = #74;
  740.  
  741. string(string s) precache_model2    = #75;        // registered version only
  742. string(string s) precache_sound2    = #76;        // registered version only
  743. string(string s) precache_file2        = #77;        // registered version only
  744.  
  745. void(entity e) setspawnparms        = #78;        // set parm1... to the
  746.                                                 // values at level start
  747.                                                 // for coop respawn
  748.  
  749. //============================================================================
  750.  
  751. //
  752. // subs.qc
  753. //
  754. void(vector tdest, float tspeed, void() func) SUB_CalcMove;
  755. void(entity ent, vector tdest, float tspeed, void() func) SUB_CalcMoveEnt;
  756. void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove;
  757. void()  SUB_CalcMoveDone;
  758. void() SUB_CalcAngleMoveDone;
  759. void() SUB_Null;
  760. void() SUB_UseTargets;
  761. void() SUB_Remove;
  762.  
  763. //
  764. //    combat.qc
  765. //
  766. void(entity targ, entity inflictor, entity attacker, float damage) T_Damage;
  767.  
  768.  
  769. // Rob
  770. //float (entity e, float healamount, float ignore) T_Heal; // health function
  771.  
  772. float(entity targ, entity inflictor) CanDamage;
  773.  
  774.  
  775. //
  776. // new_items.qc
  777. //
  778. void(entity theEntity) UpdateAmmoCounts;
  779.  
  780. //
  781. // dmatch.qc
  782. //
  783. void() tag_token_respawn;
  784. void() tag_token_touch;
  785. void() tag_token_drop;
  786.  
  787. // sphere.qc
  788. void(entity ownerEntity) sphere_remove;
  789.  
  790.  
  791. float    intermission_running;
  792. float    intermission_exittime;
  793. // Rob
  794. //////////////////////////////////////////////////////////////////////////////
  795.  
  796.  
  797. // message protocol defines
  798. float SVC_SETVIEWPORT    = 5;
  799. float SVC_SETVIEWANGLES    = 10;
  800.  
  801. float    H_ROTTEN = 1; // healthbox spawnflags
  802. float    H_MEGA = 2;
  803.  
  804.  
  805. // free player entity variable
  806. // '.float speed'  bit-flag defines:
  807. //float CHSCAM_MONSTER  = ;
  808. float CHSCAM_ON        = 1;
  809. float HUD_ON            = 2;
  810. float LASERTARG_ON    = 4;
  811. float SP_ITEMS2        = 8;
  812. float SP_VAMPIRE        = 16;
  813. float LASERTARG_LIT    = 32;
  814.  
  815. // Alternate rules for SP games
  816. float sp_altrules;
  817. // Bort's swinging hook
  818. .float sw_hook;
  819.  
  820.  
  821. float BYTEMASK1 = 255;
  822. float BYTEMASK2 = 65280;
  823. float BYTEMASK3 = 16711680;
  824. //float BYTEMASK4 = 4278190080; //bugged byte to use
  825.  
  826. // Only have 16 parms and Rogue took mine, time to switch to
  827. // an econo job... (ref client.qc)
  828.  
  829. // a negative shift should only happen on a number previously
  830. // left shifted
  831. float (float num, float sh) byte_shift =
  832. {
  833.     local float f1, cap, ret;
  834.  
  835.     ret = rint(num);
  836.     cap = fabs(8 * sh);
  837.  
  838.     f1 = 1;
  839.     while (f1 <= cap)
  840.     {
  841.         if (sh > 0)
  842.             ret = rint(ret * 2);
  843.         else
  844.             ret = rint(ret / 2);
  845.         f1 = f1 + 1;
  846.     }
  847.     return ret;
  848. };
  849.  
  850. // byte 4 not used, I must not know my float structures, using
  851. // it fucked bytes 1 and 4 up completely
  852. float( float f1, float f2, float f3) pack_parm =
  853. {
  854.     local float ret;
  855.  
  856.     // ints over 255 truncated in a level change
  857.     if (f1 > 255) f1 = 255;
  858.     if (f2 > 255) f2 = 255;
  859.     if (f3 > 255) f3 = 255;
  860.  
  861.     f1 = byte_shift( f1, 0);
  862.     f2 = byte_shift( f2, 1);
  863.     f3 = byte_shift( f3, 2);
  864.  
  865.     ret = f1 | f2 | f3;
  866.     return ret;
  867. };
  868.  
  869. float( float p, float b) get_parmbyte =
  870. {
  871.     local float ret;
  872.  
  873.     if (b == 1)
  874.         ret = p & BYTEMASK1;
  875.     else if (b == 2)
  876.         ret = byte_shift( p & BYTEMASK2, -1);
  877.     else
  878.         ret = byte_shift( p & BYTEMASK3, -2);
  879.  
  880.     return ret;
  881. };
  882.  
  883. // (c prog to write bit field numbers, definitely wouldn't trust
  884. // myself to hand tally them :-)
  885. /*
  886. #include <stdio.h>
  887. #define BYTE 8
  888. void main()
  889. {
  890.     unsigned long num, ar[BYTE], sum;
  891.     int i, j, m;
  892.     num = 1;
  893.     for (i=1; i<=32; i++)
  894.     {
  895.         printf( "// float BITFLAG%d = %lu;\n", i, num);
  896.         m = i % BYTE;
  897.         ar[m] = num;
  898.         if (! m)
  899.         {
  900.             sum =0;
  901.             for (j = 0; j < BYTE; j++) sum += ar[j];
  902.             printf( "   float BYTEMASK%d = %lu;\n\n", i/BYTE, sum );
  903.         }
  904.         num *= 2;
  905.     }
  906. }
  907. */
  908. //////////////////////////////////////////////////////////////////////////////
  909.  
  910.